package com.hhit.zhgd.service

import com.baomidou.mybatisplus.extension.plugins.pagination.Page
import com.hhit.zhgd.domain.entity.Role
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest

@SpringBootTest
class RoleServiceTests {
    @Autowired
    private var roleService: RoleService?=null
    @Test
    fun getAllTest() {
        val params = HashMap<String, Any>()
        val all = roleService?.getAll(params)
        all?.forEach {
            println(it)
        }
    }

    @Test
    fun getListTest() {
        val page = Page<Role>(1,1)
        val params = HashMap<String, Any?>()
        val list = roleService?.getList(page, params)
        list?.records?.forEach {
            println(it)
        }
    }

    @Test
    fun checkRoleTest() {
        val checkRole = roleService?.checkRole("1,2,3")
        if (checkRole == true) {
            println("true")
        } else {
            println("false")
        }
    }
}